<div class="wrapper">
    <div>
        <div class="box box-top">
            <!-- /.box-header -->
            <!-- form start -->
            <form id="companyForm" role="form" action="${base}/admin/company/save" method="post">
                <input type="hidden" name="id" value="${(company.id)!}">
                <div class="box-body">
                            <div class="form-group">
                                <label for="name">Name</label>
                                <input type="text" value="${(company.name)!}" class="form-control" name="name" id="name">
                            </div>

                            <div class="form-group">
                                <label for="status">Status</label>
                                <input type="text" value="${(company.status)!}" class="form-control" name="status" id="status">
                            </div>

                            <div class="form-group">
                                <label for="valid">Valid</label>
                                <select  name="valid" id="valid" class="form-control">
                                    <option value="true" <#if ((company.valid)!true)==true> selected="selected" </#if>>----有效----</option>
                                    <option value="false" <#if ((company.valid)!true)==false> selected="selected" </#if>>----无效----</option>
                                </select>
                            </div>

                    <div class="box-footer">
                        <button type="button" onclick="$('#companyForm').submit();" class="btn btn-primary">保存
                        </button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(function() {
        $("#companyForm").validate({
            submitHandler:function(form){
                submitCompany();
            }
        });
    });
    function submitCompany(){
        HF.ajaxFormSubmit('companyForm',function(result){
            alert("保存成功");
            document.location.reload();
        },function(e){ alert("保存失败");});
    }
</script>
